package com.enlf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.enlf.entity.FuncRelation;
import com.enlf.mapper.FuncRelationMapper;
import com.enlf.service.IFuncRelationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.management.relation.Relation;
import java.util.List;

/**
 * @author: rensiwei
 * @data: 2024-03-19
 */
@Service
public class FuncRelationServiceImpl extends ServiceImpl<FuncRelationMapper, FuncRelation> implements
        IFuncRelationService {

    @Resource
    private FuncRelationMapper funcRelationMapper;
    @Override
    public boolean save(FuncRelation entity) {
        return super.save(entity);
    }

    @Override
    public FuncRelation findByUserIdAdmin(Long userId,Integer funcId) {
        QueryWrapper<FuncRelation> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("USER_ID", userId).eq("FUNC_ID",funcId);
        return funcRelationMapper.selectOne(queryWrapper);
    }
}
